import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import static java.util.concurrent.Executors.defaultThreadFactory;

public class Demo1 {
    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExcutor = new ThreadPoolExecutor(10,10,10,
                TimeUnit.MICROSECONDS,new ArrayBlockingQueue<>(1000), defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());
        threadPoolExcutor.submit(() -> {
            System.out.println("hello");
        });
    }
}
